import math

def is_prime(num):
    if num < 2:
        return False
    for i in range(2, int(math.sqrt(num)) + 1):
        if num % i == 0:
            return False
    return True

def count_twin_primes(n):
    count = 0
    for i in range(2, n):
        if is_prime(i) and is_prime(i + 2):
            count += 1
    return count

n = int(input(""))
count = count_twin_primes(n)
print(f"{count}")